Performance management methods for electronic devices with multiple central processing units

ABSTRACT

Performance management methods for an electronic device with multiple central processing units (CPUs) are provided. First, thread loading rearrangement and CPU frequency evaluation are performed to obtain a plurality of evaluated performance values for different amounts of CPUs, wherein the plurality of evaluated performance values are relevant to power consumption values of the multiple CPUs. It is then determined whether to adjust an amount of used CPUs based on the plurality of evaluated performance values corresponding to the different amounts of CPUs.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No.61/704,283, filed Sep. 21, 2012, the entirety of which is incorporatedby reference herein.

BACKGROUND OF THE INVENTION

Field of the Invention

The disclosure relates generally to performance management methods andrelated electronic devices, and, more particularly to performancemanagement methods for an electronic device with multiple centralprocessing units.

Description of the Related Art

Central processing unit (CPU) hot-plug is an operating system mechanismthat plugs in one power-gated or power-collapsed CPU, or unplugs oneunused CPU. Particularly, on portable devices such as mobile devices,CPU hot-plug is an importance key feature to save battery life.

When determining to plug in one CPU or to unplug it, it is considerednot only save power but also retain overall system performance. In mostdesigns, frequently-used factors to determine hot-plugging consist ofcurrent CPU frequency, CPU usage, the number of running threads, and soon. However, all of them lack the capability of reflecting what wouldactually happen after hot-plugging. For example, after plugging in oneCPU, if just a thread with a small loading is offloaded to the pluggedCPU, the newly-plugged CPU may stay at an idle state for most of thetime. In such a case, however, the CPU hot-plug decision by plugging inone CPU gains little performance benefit, whereas it brings much harm topower. It is absolutely a bad trade-off.

BRIEF SUMMARY OF THE INVENTION

Performance management methods for an electronic device with multiplecentral processing units (CPUs) and related electronic devices areprovided.

In an embodiment of a performance management method for an electronicdevice with multiple central processing units (CPUs), thread loadingrearrangement and CPU frequency evaluation are first performed to obtaina plurality of evaluated performance values for different amounts ofCPUs, wherein the plurality of evaluated performance values are relevantto power consumption values of the multiple CPUs. It is then determinedwhether to adjust an amount of used CPUs based on the plurality ofevaluated performance values corresponding to the different amounts ofCPUs.

An embodiment of an electronic device includes a storage unit, aplurality of central processing units (CPUs) and a performancemanagement unit. The performance management unit is coupled to thestorage unit and the CPUs. The performance management unit is arrangedfor performing thread loading rearrangement and CPU frequency evaluationto obtain a plurality of evaluated performance values for differentamounts of CPUs, and determining whether to adjust an amount of usedCPUs based on the plurality of evaluated performance valuescorresponding to the different amounts of CPUs, wherein the plurality ofevaluated performance values are relevant to power consumption values ofthe multiple CPUs.

Performance management methods may take the form of a program codeembodied in a tangible media. When the program code is loaded into andexecuted by a machine, the machine becomes an apparatus for practicingthe disclosed method.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will become more fully understood by referring to thefollowing detailed description with reference to the accompanyingdrawings, wherein:

FIG. 1 is a schematic diagram illustrating an embodiment of anelectronic device of the invention;

FIG. 2 is a flowchart of an embodiment of a performance managementmethod of the invention;

FIG. 3 is a schematic diagram illustrating an embodiment of a lookuptable according to the invention;

FIG. 4 is a flowchart of another embodiment of a performance managementmethod for determining whether to open a new CPU of the invention;

FIG. 5 is a schematic diagram illustrating an embodiment of a CPUconfiguration according to the invention;

FIG. 6 is a flowchart of another embodiment of a performance managementmethod for determining whether to shut down a CPU of the invention; and

FIG. 7 is a flowchart of another embodiment of a performance managementmethod for determining whether to opening or shutting down a CPU of theinvention.

DETAILED DESCRIPTION OF THE INVENTION

The following description shows several exemplary embodiments whichcarry out the invention. This description is made for the purpose ofillustrating the general principles of the invention and should not betaken in a limiting sense. The scope of the invention is best determinedby reference to the appended claims.

Performance management methods for an electronic device with multiplecentral processing units (CPUs) and related electronic devices areprovided. Embodiments of the present disclosure provides a performancemanagement method for an electronic device with multiple centralprocessing units, which deduces how much thread workload will beoffloaded to a newly-plugged CPU after plugging in one CPU. Moreover,based on such deduction, the performance management method determineswhether to adjust target CPU frequency, and then to conclude on if it isthe best trade in terms of balance between power and performance.

FIG. 1 is a schematic diagram illustrating an embodiment of anelectronic device 100 of the invention. The electronic device 100 atleast comprises a storage unit 110, multiple central processing units(CPUs) CPU1, CPU2, CPU3 and CPU4 and a performance management unit 120.The electronic device 100 may be an electronic device with multiple CPUsarchitecture, such as a smartphone, a PDA (Personal Digital Assistant),a laptop computer or a tablet computer, but it is not limited thereto.The storage unit 110 may be a built-in memory, or an external memorycard, which stores related data, such as a lookup table 112 whichindicates the power relationship between the amount of used CPUs and CPUfrequency and related thread information of the multiple centralprocessing units (CPUs) CPU1, CPU2, CPU3 and CPU4, such as the number ofrunning threads for each CPU, the size, type or priority of each threadand so on, to be referenced by the performance management unit 120 forthread (or task) management. Thread loading rearrangement and CPUfrequency evaluation between the different central processing units CPU1to CPU4 can be performed via the performance management unit 120.

The performance management unit 120, which is coupled to the storageunit 110 and the CPUs CPU1, CPU2, CPU3 and CPU4, can perform theperformance management method of the present invention for determiningwhether to adjust the amount of used CPUs (or also referred to as onlineCPUs), which will be discussed further in the following paragraphs. Notethat a CPU is referred to as an unused CPU if no thread is runningthereon and a CPU is referred to as a used CPU if there are threadsrunning thereon.

To be more specific, prior to opening/plugging in or shuttingdown/unplugging a CPU, the performance management unit 120 performsthread loading rearrangement for dispatching the running threads todifferent amounts of used CPUs to deduce thread load distribution beforeopening or shutting down a CPU, then evaluates a number of performancevalues and determines whether to open or shut down the CPU based on theevaluated performance values.

FIG. 2 is a flowchart of an embodiment of a performance managementmethod of the invention. The performance management method can be usedfor an electronic device with multiple CPUs, such as a PDA, a smartphone, a mobile phone, a laptop computer or a tablet computer. Forexample, the performance management method can be performed by theperformance management unit 120 of the electronic device 100 shown inFIG. 1.

It should be noted that the original CPU hot-plug (CPU opens on andshutdown) decision is triggered when specific or periodical eventsoccur, such as each CPU frequency changes and so on. The criteria ofopening a new CPU may be, for example, that the number of runningthreads is over a pre-defined threshold, the CPU loading is over apre-defined threshold, and so on. It is determined to open a new CPUimmediately and adjust CPU frequency accordingly if the criteria ofopening new CPU have been met. In this embodiment, load balancing forthreads among used CPUs will be deduced prior to opening a new CPU orshutting a CPU down when specific or periodical events occur.

In step S202, when specific or periodical events (e.g. CPU frequencychanged and so on) occur, thread loading rearrangement and CPU frequencyevaluation are performed to obtain a plurality of evaluated performancevalues for different amounts of CPUs, wherein the plurality of evaluatedperformance values are relevant to power consumption values of thedifferent amounts of CPUs. For example, if there are total 10 CPUs inthe electronic device 100 and 5 CPUs are currently being used, thedifferent amounts of CPUs can be a first amount of used CPUs equals to5, a second amount of used CPUs equals to 6, and a third amount of usedCPUs equals to 4, respectively, wherein the first amount is the amountof CPUs being currently used, the second amount is greater than thefirst amount for indicating that an unused CPU is selected to be openedand the third amount is smaller than the first amount for indicatingthat a CPU is selected to be removed from the currently used CPUs.Therefore, thread loading rearrangement and CPU frequency evaluation areperformed to obtain a first, second and third evaluated performancevalues corresponding to the first, second and third amounts of usedCPUs, respectively.

The thread loading rearrangement is performed to deduce and distributethread loading between the evaluated amount of the used CPUs. Since thealgorithms of deducing and distributing thread loading are pervasivelyused in current operation system scheduler, the detail of the algorithmis not described here. However, it should be noted that, unlike currentoperating system scheduler uses these two algorithms directly for threadload balancing/arrangement among CPUs, the embodiment of presentinvention is to utilize these two algorithms for deducing thread loadingand evaluating the evaluated performance values which will describe moredetail later. The CPU frequency evaluation is performed to re-evaluate afrequency value corresponding to that amount of used CPUs based on therearranged thread loading. If a new thread is created or terminated, theCPU frequency evaluation could be performed, as an embodiment, bychecking the historic CPU frequency record of the thread while it was inrunning state. In one embodiment, the thread loading rearrangement canbe performed to deduce how many thread loading can be shared to a newCPU and the CPU frequency evaluation can be further performed toevaluate how to adjust current CPU frequency based on the deduced resultin the case that the new CPU is opened. In another embodiment, thethread loading rearrangement can be performed to deduce how many threadloading can be taken from a CPU which is selected to be shut down andthe CPU frequency evaluation can be further performed to evaluate how toadjust current CPU frequency based on the deduced result in the casethat the selected CPU is shut down.

In some embodiments, the first, second and third evaluated performancevalues corresponding to the first, second and third amounts of used CPUscan be obtained from a lookup table (e.g. the lookup table 112) which isstored in the storage unit 110 and stores the power relationship betweenthe amount of used CPUs and CPU frequency. In other words, an evaluatedperformance value corresponding to a specific amount of used CPUs can befound by table lookup operation based on the amount of used CPUs and there-evaluated CPU frequency value of the amount of used CPUs. The lookuptable 112 may be pre-defined in manufactory, or learnt and built whilesystem of the electronic 100 is running.

FIG. 3 is a schematic diagram illustrating an embodiment of a lookuptable 300 according to the invention. Referring to FIG. 3, the lookuptable 300 comprises fields regarding the amount of used CPUs and there-evaluated CPU frequency value and responsive performance values inunit of mA. It is understood that, in the lookup table 300, the largerthe value is, the more the power consumed at that amount of used CPUsand CPU frequency is. For example, as shown in the lookup table 300 ofFIG. 3, when a first amount of used CPUs is 3 and the CPU frequency is400 MHz, by table lookup operation, a first evaluated performance valueof 273 (mA) can be obtained. If it is then deduced that the CPUfrequency is adjusted to 300 MHz when the amount of used CPUs is changedto a second amount equal to 4, by table lookup operation, a secondevaluated performance value of 299 (mA) can be obtained. Similarly, ifit is deduced that the CPU frequency is adjusted to 1500 MHz when theamount of used CPUs is changed to a third amount equal to 2, by tablelookup operation, a third evaluated performance value of 593 (mA) can beobtained.

After the evaluated performance values for the different amounts of CPUs(e.g. the first, second and third evaluated performance valuescorresponding to the first, second and third amounts of used CPUs) havebeen obtained, in step S204, It is then determined whether to adjust anamount of used CPUs based on the plurality of evaluated performancevalues corresponding to the different amounts of CPUs.

In some embodiments, the step of determining whether to adjust theamount of used CPUs may further comprise the step of comparing thefirst, second and third evaluated performance values. When the secondevaluated performance value corresponding to the second amount of usedCPUs is smaller than the first and third evaluated performance values,it is determined to adjust the amount of used CPUs from the first amountto the second amount. When the third evaluated performance valuecorresponding to the third amount of used CPUs is smaller than the firstand second evaluated performance values, it is determined to adjust theamount of used CPUs from the first amount to the third amount. When thefirst evaluated performance value corresponding to the first amount ofused CPUs is smaller than the second and third evaluated performancevalues, it is determined to keep the amount of used CPUs unchanged.

Thus, the first evaluated performance value is compared with the secondevaluated performance value indicating the deduction result for thesecond amount of used CPUs and the third evaluated performance valueindicating the deduction result for the third amount of used CPUs. Whenthe first evaluated performance value is the smallest value between allof the evaluated performance values, it is determined that keeping thenumber of CPUs unchanged is the best choice. When the second evaluatedperformance value is the smallest value among all of the evaluationvalues, it is determined that opening a CPU is the best choice.

In the following embodiments, the amount of used CPUs can be adjusted tothe second amount by opening an unused CPU, and the amount of used CPUscan be adjusted to the third amount by shutting down a CPU selected fromthe first amount of used CPUs, but the invention is not limited thereto.Note that the number of the CPU to be opened or shut down is not limitto one. In other words, in some embodiments, the amount of used CPUs canbe adjusted by opening or shutting down more than one CPU.

FIG. 4 is a flowchart of another embodiment of a performance managementmethod for determining whether to open a new CPU of the invention. Theperformance management method can be used for an electronic device withmultiple CPUs, such as a PDA, a smart phone, a mobile phone, a laptopcomputer or a tablet computer. For example, the performance managementmethod can be performed by the performance management unit 120 of theelectronic device 100 shown in FIG. 1. In this embodiment, it is assumedthat there are total 4 CPUs in the electronic device 100 and 3 CPUs arebeing currently used, i.e. a first amount of used CPUs equals to 3.

First, thread loading rearrangement is performed to deduce distributionof thread loading based on a second amount of used CPUs in which anunused CPU is selected to be opened (step S402). For example, the secondamount of used CPUs equals to 4. Then, CPU frequency evaluation isperformed to re-evaluate a CPU frequency based on the thread loadingdistributed thereto among the second amount of used CPUs (step S404).The thread loading rearrangement is performed to deduce how many threadloading can be shared to the newly-opened CPU and the CPU frequencyevaluation is performed to evaluate a frequency value based on thededuced result. With the deduced result of distribution of threadloading to open a new CPU, as the thread loading is shared globally, thecurrent CPU frequency of the second amount of used CPUs can bedecreased.

Thereafter, a second evaluated performance value is obtained by tablelookup operation using the re-evaluated CPU frequency and the secondamount of used CPUs (step S406). For example, referring to the lookuptable 300 of FIG. 3, if the re-evaluated CPU frequency value of thesecond amount of used CPUs is 300 MHz and the second amount equals to 4,by table lookup operation, the second evaluated performance value of 299(mA) can be obtained.

The second evaluated performance value obtained is to be compared withother evaluated performance values, such as a first evaluatedperformance value indicating the deduction result for the first amountof used CPUs and a third evaluated performance value indicating thededuction result for the third amount of used CPUs to evaluate if it isthe best trade to save more power as well as retain or improve overallperformance in terms of opening a new CPU. In this embodiment, it shouldbe noted that the second amount of used CPUs running at a specific CPUfrequency or the third amount of used of CPUs running at a specific CPUfrequency is selected to compare with the first amount of used CPUs isbecause they are satisfied options for balancing the thread loadingwhile the thread loading of the amount of used CPUs is changed.

It is then determined whether the second evaluated performance value issmaller than other evaluated performance values (step S408). When thesecond evaluated performance value is smaller than other evaluatedperformance values (Yes in step S408), which means that the deduction ofload balancing indicates that to open an unused CPU is morepower-saving, it is determined to open the selected CPU to adjust theamounts of used CPUs from the first amount to the second amount (stepS410). For example, the selected CPU is opened to adjust the amounts ofused CPUs to 4. That is, 4 CPUs will be used after determination.

If the second evaluated performance value is greater than any of otherevaluated performance values (No in step S408), it is then determinedwhether currently evaluated CPU is in low performance status (stepS412). A CPU is determined as in the low performance status if thatperformance for that CPU is getting into critical situation, such as acertain number of running tasks running in low performance, waiting inrun-queue too long, getting less and less CPU resource, and so on. Ifthe currently evaluated CPU is in low performance status (Yes in stepS412), it is determined to open the selected CPU to adjust the amountsof used CPUs from the first amount to the second amount (step S414). Ifthe currently evaluated CPU is not in low performance status (No in stepS412), which means that the deduction of load balancing indicates thatto open an unused CPU cannot actually distribute loading evenly, it isdetermined not to open the new CPU and flow ends. Thus, the amount ofused CPUs keeps unchanged. That is, 3 CPUs will be used afterdetermination.

In this embodiment, the CPU frequency evaluation is performed tore-evaluate a frequency value corresponding to the second amount of usedCPUs and the CPU frequency is adjusted to the re-evaluated frequencyvalue after the unused CPU is opened. It should be understood that theoverhead of the performance method would be increased once the order foropening the CPU is revised.

Conventionally, to open CPU which is very close to other running/usedCPUs often results in poor heat dissipation and can easily cause theelectronic device to crash due to overheating. Thus, in someembodiments, thermal selection is further provided to poll thetemperature from a thermal detection circuit around the CPUs todetermine which CPU should be opened. Referring back to FIG. 1, athermal detection circuit 130 with a plurality of sensors (not shown) isfurther provided for detecting the temperatures of each CPU andproviding temperature information corresponding to each CPU. The thermalselection of the invention can be performed by the performancemanagement unit 120 according to the temperature information provided bythe sensors, wherein the CPU with the lowest temperature can be selectedto open. To be more specific, the performance management unit 120 mayobtain temperature information for each of the unused CPUs through thethermal detection circuit 130 and select to open the unused CPU with thelowest temperature value among the obtained temperature information.FIG. 5 is a schematic diagram illustrating an embodiment of a CPUconfiguration 500 of the invention. In the CPU configuration 500, fourCPUs CPU1, CPU2, CPU3 and CPU4 are illustrated, wherein the CPU1 iscurrently used CPU while the CPU2, CPU3 and CPU4 are unused CPUs.According to the thermal selection of the disclosure, as the distancebetween the CPU1 and the CPU4 is longer than that of the CPU2 and theCPU3, the temperature value for the CPU4 should be lower than that ofthe CPU2 and the CPU3 and thus the CPU4 is selected to be opened. Thus,with the thermal selection of the disclosure, the unused CPU which hasthe longer distance to other used CPUs in circuits can be selected toopen so that there is less interactive effect of temperature of CPUs andheat could be dissipated as quickly as possible, thereby efficientlyavoiding overheating.

FIG. 6 is a flowchart of another embodiment of a performance managementmethod for determining whether to shut down a CPU of the invention. Theperformance management method can be used for an electronic device withmultiple CPUs, such as a PDA, a smart phone, a mobile phone, a laptopcomputer or a tablet computer. For example, the performance managementmethod can be performed by the performance management unit 120 of theelectronic device 100 shown in FIG. 1. In this embodiment, it is assumedthat there are total 4 CPUs in the electronic device 100 and 3 CPUs arebeing currently used, i.e. a first amount of used CPUs equals to 3.

First, a CPU to be shut down is selected from the currently used CPUs(step S602). For example, the slowest frequency CPU among all CPUs whichare currently used as well as not in critical performance situation canbe selected to be shut down. Thread loading rearrangement is thenperformed to deduce distribution of thread loading based on the thirdamount of used CPUs in which the selected CPU is removed from thecurrently used CPUs (step S604). For example, the third amount of usedCPUs equals to 2. Then, CPU frequency evaluation is performed tore-evaluate a CPU frequency value based on the thread loadingdistributed thereto among the third amount of used CPUs (step S606). Thethread loading rearrangement is performed to deduce how many threadloading can be taken from the selected CPU and the CPU frequencyevaluation is performed to evaluate a frequency value based on thededuced result. With the deduced result of distribution of threadloading to shut down a CPU, as the thread loading is shared globally,the current CPU frequency of the third amount of used CPUs should beincreased.

Thereafter, a third evaluated performance value is obtained by tablelookup operation using the re-evaluated CPU frequency and the thirdamount of used CPUs (step S608). For example, referring to the lookuptable 300 of FIG. 3, if the re-evaluated CPU frequency value of thethird amount of used CPUs is 1500 MHz and the third amount equals to 2,by table lookup operation, the third evaluated performance value of 593(mA) can be obtained.

The third evaluated performance value obtained is to be compared withother evaluated performance values to evaluate if it is the best tradeto save more power as well as retain or improve overall performance interms of shutting the selected CPU down.

It is then determined whether the third evaluated performance value issmaller than other evaluated performance values (step S610). When thethird evaluated performance value is smaller than other evaluatedperformance values (Yes in step S610), which means that the deduction ofload balancing indicates that to shut the selected CPU down is morepower-saving, it is determined to shut the selected CPU down to adjustthe amounts of used CPUs from the first amount to the third amount (stepS612). For example, the selected CPU is closed to adjust the amounts ofused CPUs to 2. That is, 2 CPUs will be used after determination.

In this step, the CPU frequency evaluation is performed to re-evaluate afrequency value corresponding to the third amount of used CPUs and theCPU frequency is adjusted to the re-evaluated frequency value before theselected CPU is shut down.

When the third evaluated performance value is greater than any of otherevaluated performance values (No in step S610), it is determined not toshut the selected CPU down and flow ends. Thus, the amount of used CPUskeeps unchanged. That is, 3 CPUs will be used after determination.

FIG. 7 is a flowchart of another embodiment of a performance managementmethod for determining whether to opening or shutting down a CPU of theinvention. The performance management method can be used for anelectronic device with multiple CPUs, such as a PDA, a smart phone, amobile phone, a laptop computer or a tablet computer. For example, theperformance management method can be performed by the performancemanagement unit 120 of the electronic device 100 shown in FIG. 1. Inthis embodiment, it is assumed that there are total 4 CPUs in theelectronic device 100 and 3 CPUs are being currently used, i.e. a firstamount of used CPUs equals to 3.

When CPU hot-plug decision is triggered due to occurrence of specific orperiodical events (such as each CPU frequency changes and so on), threadloading rearrangement and CPU frequency evaluation are performed toobtain a first, second and third evaluated performance values for afirst, second and third amounts of used CPUs, respectively (step S702).In this step, the second amount of used CPUs, which includes an unusedCPU selected to be opened is greater than the first amount, and thethird amount of used CPUs, which removes the smallest CPU from thecurrent used CPUs, is smaller than the first amount. For example, inthis embodiment, the second amount of used CPUs equals to 4 and thethird amount of used CPUs equals to 2. Note that steps S402 to S406described in FIG. 4 or steps S604 to S608 described in FIG. 6 can beperformed to obtain the first, second and third evaluated performancevalues, thus details are omitted here for brevity.

After the first, second and third evaluated performance values have beenobtained, it is then determined which evaluated performance value is theminimum value among the first, second and third evaluated performancevalues (step S704). If it is determined that the first evaluatedperformance value is the minimum value in step S704, step S706 isperformed to set CPU frequency to the re-evaluated frequency value onlyand keep the amount of used CPUs unchanged. That is, no CPU will beopened or shut down after determination. If it is determined that thesecond evaluated performance value is the minimum value in step S704,step S708 is performed to open the newly selected CPU by thermalselection and then set CPU frequency to the re-evaluated frequencyvalue. If it is determined that the third evaluated performance value isthe minimum value in step S704, step S710 is further performed to setCPU frequency to the re-evaluated frequency value first and then shutthe selected CPU down. Therefore, based on deduction for opening one newCPU, the deduction for shutting the slowest frequency CPU down and thededuction for changing the CPU frequency only, the solution that is ableto save the most power and retain overall system performance will bepicked as the winner for performance management.

For example, if the currently CPU frequency for the first amount of usedCPU is 400 MHz and it is adjusted to a frequency value of 300 MHz and1500 MHz for the second and third amounts of used CPUs, respectively, bytable lookup operation using the lookup table 300 in FIG. 3, the first,second and third evaluated performance values are 273, 299 and 593,respectively. As the first evaluated performance value is the minimumvalue among all of the evaluated performance values, step S706 isperformed to set CPU frequency only and the amount of used CPUs keepsunchanged. That is, no CPU will be opened or shut down. In anotherembodiment, if the first, second and third evaluated performance valuesare 273, 204 and 593, respectively, step S708 is performed to open thenewly selected CPU by thermal selection and then set CPU frequency tothe re-evaluated frequency value.

In summary, the performance management methods for an electronic devicewith multiple CPUs and related electronic devices of the invention candeduce the distribution of thread loading prior to opening or shuttingdown the CPU(s), then determine if the current CPU frequency can beadjusted accordingly and evaluate a number of performance values, anddetermine whether to open or shut down the CPU based on the evaluatedperformance values to make the best decision in which balanced is soughtbetween power and performance for the amount of used CPUs, thus savingpower and resulting in a longer battery life.

Performance management methods, or certain aspects or portions thereof,may take the form of a program code (i.e., executable instructions)embodied in tangible media, such as floppy diskettes, CD-ROMS, harddrives, or any other machine-readable storage medium, wherein, when theprogram code is loaded into and executed by a machine, such as acomputer, the machine thereby becomes an apparatus for practicing themethods. The methods may also be embodied in the form of a program codetransmitted over some transmission medium, such as electrical wiring orcabling, through fiber optics, or via any other form of transmission,wherein, when the program code is received and loaded into and executedby a machine, such as a computer, the machine becomes an apparatus forpracticing the disclosed methods. When implemented on a general-purposeprocessor, the program code combines with the processor to provide aunique apparatus that operates analogously to application-specific logiccircuits.

While the invention has been described by way of example and in terms ofpreferred embodiment, it is to be understood that the invention is notlimited thereto. Those who are skilled in this technology can still makevarious alterations and modifications without departing from the scopeand spirit of this invention. Therefore, the scope of the presentinvention shall be defined and protected by the following claims andtheir equivalent.

What is claimed is:
 1. A performance management method for an electronicdevice with multiple central processing units (CPUs), comprising:performing thread loading rearrangement and CPU frequency evaluation toobtain a plurality of evaluated performance values for different amountsof CPUs, wherein the plurality of evaluated performance values arerelevant to power consumption values of the multiple CPUs; anddetermining whether to adjust an amount of used CPUs based on theplurality of evaluated performance values corresponding to the differentamounts of CPUs, wherein the step of performing thread loadingrearrangement and CPU frequency evaluation to obtain the plurality ofevaluated performance values for the different amounts of CPUs furthercomprises: performing thread loading rearrangement and CPU frequencyevaluation to obtain a first, second and third evaluated performancevalues for a first, second and third amounts of used CPUs, respectively,wherein the first amount of used CPUs indicates the amount of CPUs whichare being currently used, the second amount of used CPUs indicates theamount of CPUs which are being currently used plus an amount of CPUsassumed to be opened, and the third amount of used CPUs indicates theamount of CPUs which are being currently used minus the amount of CPUsassumed to be shut down, and wherein the step of performing threadloading rearrangement and CPU frequency evaluation to obtain the first,second and third evaluated performance values for the first, second andthird amounts of used CPUs further comprises: performing the threadloading rearrangement to deduce an amount of thread loading that can bedistributed to the amount of CPUs assumed to be opened or deduce anamount of thread loading that can be taken from the amount of CPUsassumed to be shut down; performing the CPU frequency evaluation toobtain a respective predicted CPU frequency for the first, second andthird amounts of used CPUs based on the deduced result; and evaluatingthe first, second and third evaluated performance values for the first,second and third amounts of used CPUs, respectively, based on thepredicted CPU frequencies.
 2. The method of claim 1, wherein the step ofdetermining whether to adjust the amount of used CPUs further comprises:comparing the first, second and third evaluated performance values;determining to adjust the amount of used CPUs from the first amount tothe second amount when the second evaluated performance valuecorresponding to the second amount of used CPUs is smaller than thefirst and third evaluated performance values; and determining to adjustthe amount of used CPUs from the first amount to the third amount whenthe third evaluated performance value corresponding to the third amountof used CPUs is smaller than the first and second evaluated performancevalues.
 3. The method of claim 2, wherein the amount of used CPUs isadjusted to the second amount by opening an unused CPU, and the amountof used CPUs is adjusted to the third amount by shutting down a CPUselected from the first amount of used CPUs.
 4. The method of claim 3,wherein the CPU frequency evaluation is performed to re-evaluate afrequency value corresponding to the second amount of used CPUs and theCPU frequency is adjusted to the re-evaluated frequency value after theunused CPU is opened.
 5. The method of claim 3, wherein the CPUfrequency evaluation is performed to re-evaluate a frequency valuecorresponding to the third amount of used CPUs and the CPU frequency isadjusted to the re-evaluated frequency value before the selected CPU isshut down.
 6. The method of claim 3, further comprising: when the secondevaluated performance value corresponding to the second amount of usedCPUs is greater than the first and third evaluated performance values,determining whether currently evaluated CPU is in a low-performancestatus; and determining to adjust the amount of used CPUs from the firstamount to the second amount when the currently evaluated CPU is in thelow-performance status.
 7. The method of claim 3, further comprising:providing a temperature information for each of unused CPUs in the CPUs;and selecting the unused CPU with the lowest temperature value among theprovided temperature information to open.
 8. The method of claim 3,wherein the CPU which is selected from the first amount of used CPUs tobe shut down is the lowest frequency CPU among the first amount of usedCPUs.
 9. The method of claim 1, wherein the first, second and thirdevaluated performance values are obtained by table lookup operationusing a lookup table.
 10. An electronic device, comprising: a storageunit; a plurality of central processing units (CPUs); and a performancemanagement unit coupled to the storage unit and the CPUs, performingthread loading rearrangement and CPU frequency evaluation to obtain aplurality of evaluated performance values for different amounts of CPUs,and determining whether to adjust an amount of used CPUs based on theplurality of evaluated performance values corresponding to the differentamounts of CPUs, wherein the plurality of evaluated performance valuesare relevant to power consumption values of the plurality of CPUs,wherein the performance management unit further performs thread loadingrearrangement and CPU frequency evaluation to obtain a first, second andthird evaluated performance values for a first, second and third amountsof used CPUs, respectively, wherein the first amount of used CPUsindicates the amount of CPUs which are being currently used, the secondamount of used CPUs indicates the amount of CPUs which are beingcurrently used plus an amount of CPUs assumed to be opened, and thethird amount of used CPUs indicates the amount of CPUs which are beingcurrently used minus the amount of CPUs assumed to be shut down, andwherein the performance management unit further performs thread loadingrearrangement and CPU frequency evaluation to obtain the first, secondand third evaluated performance values for the first, second and thirdamounts of used CPUs by performing the thread loading rearrangement todeduce an amount of thread loading that can be distributed to the amountof CPUs assumed to be opened or deduce an amount of thread loading thatcan be taken from the amount of CPUs assumed to be shut down, performingthe CPU frequency evaluation to obtain a respective predicted CPUfrequency for the first, second and third amounts of used CPUs based onthe deduced result and evaluating the first, second and third evaluatedperformance values for the first, second and third amounts of used CPUs,respectively, based on the predicted CPU frequencies.
 11. The electronicdevice of claim 10, wherein the performance management unit furthercompares the first, second and third evaluated performance values,wherein the performance management unit determines to adjust the amountof used CPUs from the first amount to the second amount when the secondevaluated performance value corresponding to the second amount of usedCPUs is smaller than the first and third evaluated performance values,and determines to adjust the amount of used CPUs from the first amountto the third amount when the third evaluated performance valuecorresponding to the third amount of used CPUs is smaller than the firstand second evaluated performance values.
 12. The electronic device ofclaim 11, wherein the performance management unit adjusts the amount ofused CPUs to the second amount by opening an unused CPU, and adjusts theamount of used CPUs the third amount by shutting down a CPU selectedfrom the first amount of used CPUs.
 13. The electronic device of claim12, wherein the CPU frequency evaluation is performed to re-evaluate afrequency value corresponding to the second amount of used CPUs and theCPU frequency is adjusted to the re-evaluated frequency value after theunused CPU is opened.
 14. The electronic device of claim 12, wherein theCPU frequency evaluation is performed to re-evaluate a frequency valuecorresponding to the third amount of used CPUs and the CPU frequency isadjusted to the re-evaluated frequency value before the selected CPU isshut down.
 15. The electronic device of claim 12, wherein when thesecond evaluated performance value corresponding to the second amount ofused CPUs is greater than the first and third evaluated performancevalues, the performance management unit further determines whethercurrently evaluated CPU is in a low-performance status, and determinesto adjust the amount of used CPUs from the first amount to the secondamount when the currently evaluated CPU is in the low-performancestatus.
 16. The electronic device of claim 12, further comprising athermal detection circuit with a plurality of sensors for providing atemperature information for each of the CPUs, wherein the performancemanagement unit further obtains a temperature information for each ofunused CPUs in the CPUs through the thermal detection circuit andselects the unused CPU with the lowest temperature value among theobtained temperature information to open.
 17. The electronic device ofclaim 12, wherein the storage unit further stores a lookup table and theperformance management unit further obtains the first, second and thirdevaluated performance values by table lookup operation using the lookuptable.
 18. The electronic device of claim 12, wherein the CPU which isselected from the first amount of used CPUs to be shut down is thelowest frequency CPU among the first amount of used CPUs.